/*
 * Shape.h
 *
 *  Created on: Jan 5, 2014
 *      Author: nick
 */

#ifndef SHAPE_H_
#define SHAPE_H_

//Include files
#include "SDL/SDL.h"
#include "Tile.h"
#include "Level.h"
#include "sdlFunctions.h"
#include <iostream>

using namespace std;

class Shape
{
	//Protected so that only child classes make access the data
    protected:
		//The dot's collision box
	    SDL_Rect box;

	    //The velocity of the dot
	    float xVel = 0.0, yVel = 0.0;

	    float jump = 0.0;

	    int type;

    public:
/*!
 *  @brief Constructor for a blank shape.
 */
        Shape();
/*!
 *  @brief Constructor which initializes data to the values passed in.
 */
        Shape( float x, float y , float jump = 0 );
/*!
 *  @brief Constructor which copies the values from another shape into the new shape
 * 			that is being created.
 */
		Shape( const Shape* old );

/*!
 *  @brief Destructor
 */
        virtual ~Shape( );



        //Moves the dot
        void move( Tile *tiles[] );





/*!
 *  @brief Outputs the two (x,y) coordinates stored within the class.
 * 			Made virtual so children may print their extra class variables.
 */
		virtual void Print();

/*!
 *  @brief Checks to see if a point is within the area of the shape.
 *		   Pure virtual so children must override with their area formula.
 */
		virtual bool isWithin( float x, float y ) = 0;

/*!
 *  @brief Calls the Glut draw function.  Pure virtual so that each shape
 * 			must use their own draw function.
 */
        virtual void show() const = 0;

/*!
 *  @brief This returns a pointer to a shape of the current type with all
 *	the same values.  Pure virtual so each child must return a shape* to
 *	their type
 */
		virtual Shape * Clone() const = 0;



		//Addded from the dot file

		//Takes key presses and adjusts the dot's velocity
		    void handle_input();


		    //Sets the camera over the dot
		    void set_camera();

		    int get_x();

		    int get_y();


		    int get_type();

		    SDL_Rect get_box();

		    void gravity(Tile *tiles[], int t);
};


#endif /* SHAPE_H_ */
